// layout
import layoutHeaderAside from '@/layout/header-aside'
import layoutHeaderNoAside from '@/layout/header-no-aside'
import layoutHeaderProjectTreeAside from '@/layout/headr-project-aside'
import layoutHeaderProjecUserAside from '@/layout/headr-user-aside'
const meta = {requiresAuth: true}

/**
 * 在主框架内显示
 */
const frameIn = [
    {
        path: '/',
        redirect: {name: 'index'},
        component: layoutHeaderAside,
        children: [
            {
                path: 'index',
                name:'index',
                meta,
                component: () => import('@/pages/index')
            }
        ]
    },
    {
        path: '/',
        redirect: {name: 'warning'},
        component: layoutHeaderNoAside,
        children: [
            {
                path: 'warning',
                name: 'warning',
                component: () => import('@/pages/warning'),
                meta: {...meta, title: '告警信息'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'patrolMission',
                name: 'patrolMission',
                component: () => import('@/pages/patrolMission'),
                meta: {...meta, title: '巡查任务'}
            }
        ]


    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'patrolDetail',
                name: 'patrolDetail',
                component: () => import('@/pages/patrolDetail'),
                meta: {...meta, title: '巡查详情'}
            }
        ]


    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'projectMaintenance',
                name: 'projectMaintenance',
                component: () => import('@/pages/projectMaintenance'),
                meta: {...meta, title: '项目维护'}
            }
        ]


    },
    {
        path: '/',

        component: layoutHeaderNoAside,
        children: [
            {
                path: 'projectWeekly',
                name: 'projectWeekly',
                component: () => import('@/pages/projectWeekly'),
                meta: {...meta, title: '项目周报'}
            }
        ]


    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'deviceMonitor',
                name: 'deviceMonitor',
                component: () => import('@/pages/deviceMonitor'),
                meta: {...meta, title: '设备监测'}
            }
        ]


    },

    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'deviceWatch',
                name: 'deviceWatch',
                component: () => import('@/pages/deviceWatch'),
                meta: {...meta, title: '设备监测'}
            }
        ]


    },

    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'userManage',
                name: 'userManage',
                component: () => import('@/pages/userManage'),
                meta: {...meta, title: '用户管理'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderNoAside,
        children: [
            {
                path: 'deviceUpgrade',
                name: 'deviceUpgrade',
                component: () => import('@/pages/deviceUpgrade'),
                meta: {...meta, title: '设备升级'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderNoAside,
        children: [
            {
                path: 'patrolItemConfig',
                name: 'patrolItemConfig',
                component: () => import('@/pages/patrolItemConfig'),
                meta: {...meta, title: '巡查项配置'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'patrolConfig',
                name: 'patrolConfig',
                component: () => import('@/pages/patrolConfig'),
                meta: {...meta, title: '巡查配置'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'userTransConfig',
                name: 'userTransConfig',
                component: () => import('@/pages/userTransConfig'),
                meta: {...meta, title: '用传配置'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderNoAside,
        children: [
            {
                path: 'userRoleMana',
                name: 'userRoleMana',
                component: () => import('@/pages/userRoleMana'),
                meta: {...meta, title: '角色管理'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderNoAside,
        children: [
            {
                path: 'corporateMana',
                name: 'corporateMana',
                component: () => import('@/pages/corporateMana'),
                meta: {...meta, title: '公司管理'}
            }
        ]
    },
    {
        path: '/',

        component: layoutHeaderProjecUserAside,
        children: [
            {
                path: 'test',
                name: 'test',
                component: () => import('@/pages/test'),
                meta: {...meta, title: '测试'}
            }
        ]
    }
]

/**
 * 在主框架之外显示
 */
const frameOut = [
    // 页面重定向使用 必须保留
    {
        path: '/redirect/:path*',
        component: () => import('@/pages/redirect')
    },
    // 登录
    {
        path: '/login',
        name: 'login',
        component: () => import('@/pages/login')
    },
    //大屏
    {
        path:'/visual',
        name:'visual',
        component:()=>import('@/pages/visual')
    }

]

/**
 * 错误页面
 */
const errorPage = [
    // 404
    {
        path: '*',
        name: '404',
        component: () => import('@/pages/error-page-404')
    }
]

// 导出需要显示菜单的
export const frameInRoutes = frameIn

// 重新组织后导出
export default [
    ...frameIn,
    ...frameOut,
    ...errorPage
]
